import request from '@/utils/request'

// 查询IP智能调度列表
export function listPool(query) {
  return request({
    url: '/system/pool/list',
    method: 'get',
    params: query
  })
}

// 查询IP智能调度树状列表
export function treeNodePool(query) {
  return request({
    url: '/system/pool/treePool',
    method: 'get',
    params: query
  })
}
// 查询IP智能调度详细
export function getPool(id) {
  return request({
    url: '/system/pool/' + id,
    method: 'get'
  })
}

// 新增IP智能调度
export function addPool(data) {
  return request({
    url: '/system/pool',
    method: 'post',
    data: data
  })
}

// 修改IP智能调度
export function updatePool(data) {
  return request({
    url: '/system/pool',
    method: 'put',
    data: data
  })
}

// 删除IP智能调度
export function delPool(id) {
  return request({
    url: '/system/pool/' + id,
    method: 'delete'
  })
}

// 节点池ip列表
export function getPoolIp(query) {
  return request({
    url: '/system/poolip/list',
    method: 'get',
    params: query
  })
}

// 删除节点池ip
export function delPoolIp(id) {
  return request({
    url: '/system/poolip/' + id,
    method: 'post',
    params: id
  })
}
// 节点池 添加ip 搜索功能
export function seachIpList(query) {
  return request({
    url: '/system/master/seachIpList',
    method: 'get',
    params: query
  })
}

// 节点池 标签回显
export function selectLabelByPoolId(data) {
  return request({
    url: '/system/pool/selectLabelByPoolId',
    method: 'get',
    params: data
  })
}

// 节点池添加标签
export function addPoolTag(data, headers) {
  return request({
    url: '/system/poollabel/addList',
    method: 'post',
    data: data,
    headers
  })
}

// IP管理 节点池ip设置
export function configPoolip(data) {
  return request({
    url: '/system/pool/config',
    method: 'post',
    data: data
  })
}
